import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/assets/global.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import request from "./utils/request"
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {ElMessage} from 'element-plus'


//main.ts文件
import * as ELIcons from '@element-plus/icons-vue'
import * as ElementIcons from '@element-plus/icons'
import '@/style/blog/base.less';
// import '@/style/public/common.less';
// import nightMode from '@/style/public/night-mode.less';

// function nightMode(){
//     import ('@/style/public/night-mode.less');
// }
//
// let reg = /^\/$/   //判断是否为/admin/下路径
// if(reg.test(router.currentRoute.value.path)){
//     nightMode()
// }

// 统一注册Icon图标
// for (const iconName in ElIconModules) {
//     if (Reflect.has(ElIconModules, iconName)) {
//         const item = ElIconModules[iconName]
//         app.component(iconName, item)
//     }
// }
for (let iconName in ELIcons) {
    createApp(App).component(iconName, ELIcons[iconName])
}

for (let iconName in ElementIcons) {
    createApp(App).component(iconName, ELIcons[iconName])
}
// console.log("app",createApp(App))

createApp(App).config.productionTip = false


createApp(App).use(store).use(router).use(ElementPlus).mount('#app')
